package day04;

import java.util.ArrayList;
import java.util.Collections;

/**
 * 创建一个List集合，并添加元素0-9
 * 将集合转换为一个Integer数组并输出数组每一个元素
 * @author Bonnie
 *
 */
public class Test05 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,0,1,2,3,4,5,6,7,8,9);
        Integer[] array=list.toArray(new Integer[0]);
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
    }
}
